
import collections
import os
import re

open('1.txt', mode='w').writelines('\n'.join(['print','"a"','#1 #2','#3:','','']))

v1 = open('1.txt',encoding='utf8',mode='r').readlines()

h = collections.defaultdict(lambda: collections.defaultdict(lambda: {}))
p = [0]

h['key'].update({'print':[1, 1]})
# key: [*exec, paraments]
h['exec'].update({1:{0:[2], 1:'print(', 2:'', 3:')'}})


for v2 in range(len(v1)):
    if v1[v2].isspace() : continue
    h['line'][v2] = []
    v4 = re.findall(r'#*[a-z0-9]+', v1[v2])
    for v3 in range(len(v4)):
        v5 = v4[v3]
        if v5.isspace() : continue
        h['line'][v2].append(v5)
        #if v5=='print':
        #h['line'][v2].update({v3:[h['key'][v5][0]]})

print(h)
